<!DOCTYPE html>
<body>
<div style="width:100px; overflow:scroll;">
<div style="width:1000px;">
<input><input value=abc autofocus style="width:64px;">
</div>
</div>
<script>
if (window.testRunner) {
    testRunner.waitUntilDone();
    document.querySelectorAll('input')[1].addEventListener('focus', function(event) {
        event.target.select();
        testRunner.notifyDone();
    }, false);
} else {
    console.log('Require testRunner.');
}
</script>
</body>
